package com.lanxin.hr.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lanxin.hr.entity.ZzJobinfo;
import com.lanxin.hr.mapper.ZzJobinfoMapper;
import com.lanxin.hr.service.IZzJobinfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author author
 * @since 2025-07-26
 */
@Service
public class ZzJobinfoServiceImpl extends ServiceImpl<ZzJobinfoMapper, ZzJobinfo> implements IZzJobinfoService {

    @Autowired
    private ZzJobinfoMapper jobinfoMapper;

    //根据员工id查询工作信息
    @Override
    public ZzJobinfo getJobinfoByEid(Integer eid) {
        QueryWrapper<ZzJobinfo> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("empid",eid);
        return jobinfoMapper.selectOne(queryWrapper);
    }

    //更新工作信息
    @Override
    public int updateJobinfoById(ZzJobinfo jobinfo) {
        return jobinfoMapper.updateById(jobinfo);
    }

    //删除工作信息
    @Override
    public int deleteJobinfoById(Integer eid) {
        return jobinfoMapper.deleteById(eid);
    }
}
